import Vue from 'vue'
import Router from 'vue-router'
const _import = require('./_import_' + process.env.NODE_ENV)

Vue.use(Router)

export const constantRouterMap = [
  { path: '/', component: _import('welcome'), hidden: true },
  { path: '/test', component: _import('test'), hidden: true },
  { path: '/find', component: _import('find'), meta: { keepAlive: true }, hidden: true },
  { path: '/reg', component: _import('reg'), meta: { keepAlive: true }, hidden: true },
  { path: '/reginfo', component: _import('reginfo'), meta: { keepAlive: true }, hidden: true },
  { path: '/regtips', component: _import('regtips'), meta: { keepAlive: true }, hidden: true },
  { path: '/protocol', component: _import('protocol'), meta: { keepAlive: true }, hidden: true },
  { path: '/demandlist', component: _import('demandlist'), meta: { keepAlive: true }, hidden: true },
  { path: '/info', component: _import('info'), meta: { keepAlive: true }, hidden: true },
  { path: '/train', component: _import('train'), meta: { keepAlive: true }, hidden: true },
  { path: '/trainlist', component: _import('trainlist'), meta: { keepAlive: true }, hidden: true },
  { path: '/traindetails', component: _import('traindetails'), meta: { keepAlive: false }, hidden: true }
]

export default new Router({
  // mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
